﻿using System;
using UnityEngine;

// Token: 0x02000013 RID: 19
public class ExploTransform : MonoBehaviour
{
	// Token: 0x0600004D RID: 77 RVA: 0x00008818 File Offset: 0x00006A18
	private void Update()
	{
		if (Input.GetKeyDown(this.exploCode[this.sequenceIndex]))
		{
			int num = this.sequenceIndex + 1;
			this.sequenceIndex = num;
			if (num == this.exploCode.Length)
			{
				this.sequenceIndex = 0;
				if (GameManager.main.playerBody.skinnable)
				{
					GameManager.main.playerBody.headSprites = this.headSprites;
					GameManager.main.playerBody.torsoSprites = this.torsoSprites;
					GameManager.main.playerBody.handSprites = this.handSprites;
					GameManager.main.playerBody.headJoint.connectedAnchor += Vector2.down * 0.23f;
					foreach (Rigidbody2D rigidbody2D in GameManager.main.playerBody.feet)
					{
						rigidbody2D.GetComponent<SpriteRenderer>().sprite = this.feetSprite;
					}
					GameObject gameObject = Object.Instantiate(Resources.Load("Skins/Explo/ExploHead"), GameManager.main.playerBody.head.transform) as GameObject;
					gameObject.transform.localPosition = this.headPos;
					gameObject.transform.localScale = Vector3.one;
					GameObject gameObject2 = Object.Instantiate(Resources.Load("Skins/Explo/ExploTail"), GameManager.main.playerBody.torso.transform) as GameObject;
					gameObject2.transform.localPosition = this.tailPos;
					gameObject2.transform.localScale = Vector3.one;
					GameManager.main.playerBody.bloodColor = this.bloodcolor;
					GameManager.main.playerBody.lookDir = -GameManager.main.playerBody.lookDir;
					GameManager.main.playerBody.dizzyIconColor = this.indicatorColor;
					GameManager.main.playerBody.skinnable = false;
					PauseManager.main.TryUnlockAchievement(17);
					return;
				}
			}
		}
		else if (Input.anyKeyDown)
		{
			this.sequenceIndex = 0;
		}
	}

	// Token: 0x040000DA RID: 218
	public KeyCode[] exploCode;

	// Token: 0x040000DB RID: 219
	private int sequenceIndex;

	// Token: 0x040000DC RID: 220
	public Sprite[] headSprites;

	// Token: 0x040000DD RID: 221
	public Sprite[] torsoSprites;

	// Token: 0x040000DE RID: 222
	public Sprite[] handSprites;

	// Token: 0x040000DF RID: 223
	public Sprite feetSprite;

	// Token: 0x040000E0 RID: 224
	public GameObject headfire;

	// Token: 0x040000E1 RID: 225
	public GameObject tailFire;

	// Token: 0x040000E2 RID: 226
	public Vector2 tailPos;

	// Token: 0x040000E3 RID: 227
	public Vector2 headPos;

	// Token: 0x040000E4 RID: 228
	public Color bloodcolor;

	// Token: 0x040000E5 RID: 229
	public Color indicatorColor;
}
